package com.emergency.assist.domain;

import com.emergency.base.domain.BaseEntity;
import com.emergency.base.domain.Scenar;

import javax.persistence.*;

/**
 * 路线的节点关系类
 */
@Entity
@Table(name = "bus_route_relation")
public class RouteRelation extends BaseEntity {

    //路线
    @OneToOne(targetEntity = Route.class, fetch = FetchType.EAGER)
    @JoinColumn(name = "route_id", referencedColumnName = "id")
    private Route route;

    //路线起始点
    @OneToOne(targetEntity = RoutePoint.class, fetch = FetchType.EAGER)
    @JoinColumn(name = "point_id", referencedColumnName = "id")
    private RoutePoint routePoint;

    //想定
    @OneToOne(targetEntity = Scenar.class, fetch = FetchType.EAGER)
    @JoinColumn(name = "scenar_id", referencedColumnName = "id")
    private Scenar scenar;

    @Column
    private Double weight;

    public Route getRoute() {
        return route;
    }

    public void setRoute(Route route) {
        this.route = route;
    }

    public RoutePoint getRoutePoint() {
        return routePoint;
    }

    public void setRoutePoint(RoutePoint routePoint) {
        this.routePoint = routePoint;
    }

    public Scenar getScenar() {
        return scenar;
    }

    public void setScenar(Scenar scenar) {
        this.scenar = scenar;
    }

    public Double getWeight() {
        return weight;
    }

    public void setWeight(Double weight) {
        this.weight = weight;
    }
}
